#pragma once
#include "Page.h"
#include "ChangePage.h"
#include <functional>
#include <string>
#include <map>
#include <stack>

namespace Router {
	namespace Add {
		void addPage(const std::string& key, std::function<std::unique_ptr<Page>(std::shared_ptr<ChangePage>)> factory);
	}
	void push(std::shared_ptr<ChangePage> parent,const std::string& key);
	void replace(std::shared_ptr<ChangePage> parent, const std::string& key);
	void back(std::shared_ptr<ChangePage> parent);
}

inline std::map<std::string, std::function<std::unique_ptr<Page>(std::shared_ptr<ChangePage>)>> PageMap{};
inline std::stack<std::unique_ptr<Page>> PageStack{};

